#import "BinaryInfiniteController.h"
        
#import "BinaryInfiniteModel.h"
#import "BinaryInfiniteCell.h"
#import "Masonry.h"

@interface BinaryInfiniteController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *luminousBlossomTableView;
@property (nonatomic, strong) NSMutableArray *nirvanaFractalArr;

@end

@implementation BinaryInfiniteController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self blazeOracleSetuplayout];
	[self nebulaAppleStillnessloadData];
}


//: 获取数据模型
- (void)nebulaAppleStillnessloadData {
	
}

//: 初始化页面UI
- (void)blazeOracleSetuplayout {

	[self.view addSubview:self.luminousBlossomTableView];
	[self.luminousBlossomTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


//: 懒加载数据模型数组
- (NSMutableArray *)nirvanaFractalArr {
	if (!_nirvanaFractalArr) {
		_nirvanaFractalArr = [NSMutableArray array];
	}
	return _nirvanaFractalArr;
}

- (UITableView *)figHandleTableView {
    if (!_luminousBlossomTableView) {
        _luminousBlossomTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _luminousBlossomTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _luminousBlossomTableView.estimatedRowHeight = 0;
        _luminousBlossomTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _luminousBlossomTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _luminousBlossomTableView.delegate = self;
        _luminousBlossomTableView.dataSource = self;
        _luminousBlossomTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _luminousBlossomTableView.showsVerticalScrollIndicator = NO;
        _luminousBlossomTableView.showsHorizontalScrollIndicator = NO;
        _luminousBlossomTableView.backgroundColor = UIColor.clearColor;
    }
    return _luminousBlossomTableView;
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.nirvanaFractalArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    BinaryInfiniteCell *swayImaginationKite = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([BinaryInfiniteCell class])];
    if (swayImaginationKite == nil) {
        swayImaginationKite = [[BinaryInfiniteCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([BinaryInfiniteCell class])];
    }
    swayImaginationKite.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return swayImaginationKite;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	BinaryInfiniteModel *volatileElevatePerceptive = self.nirvanaFractalArr[indexPath.row];
	return volatileElevatePerceptive.dazzleSwayNostalgiaCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
